<?php include 'config.php';?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>天生我财--资讯首页</title>
<link rel="stylesheet" type="text/css" href="common/css/new_header.css">
<script type='text/javascript' src='common/js/jquery.js'></script>
<style type="text/css">
*{margin:0px;}
body {
	font-family: "宋体";
	font-size:12px;
}

#top {
	width:976px;
	height:44px;
	background-image:url(common/image/1.jpg);
}
.clear {clear: both;}

#sj {width:985px;margin:10px auto;padding:0px;}

#sj .sj_l{margin:5px;background-color:#f0f8fc;
border: 1px solid #76c3e5;border-top:0px;width:470px;max-width:480px;min-width:480px;height:310px;
min-height:300px;max-height:300px;}
#sj .neir_1{height:30px;background:url(common/image/2.jpg) -1px 0px no-repeat;padding-bottom:5px;overflow:hidden;}

#sj .neir_1 h1{float:left;width:340px;font-size:14px;color:#003466;height:50px;line-height:50px;margin-left:38px;cursor:move;}
#sj .hd {padding:10px;overflow:hidden;}


#sj .hd img{border:solid #76c3e5 1px;margin:6px 15px;}
#sj .hd ul{margin:3px 15px;line-height:27px;}
#sj .hd li{line-height:27px;height:27px;overflow:hidden;}

#sj a{line-height:27px;height:27px;color:#003466;text-decoration:none;}

#sj a:hover{
	color:#ff0000;
}

#sj a:visited{
	text-decoration:none
} 

#sj .hd span {
	color:#6380ac;
	margin-left:10px;
}
#sj .more {
	font-size:12px;
	font-weight:lighter;
	float:left;
	margin-top:16px;
}
.spec li{width:31%;float:left;line-height:27px;height:27px;overflow:hidden;}
.spec .neir_1 h1{padding-top:2px;}
.user-c2,.user-c{display:none;line-height:25px;text-align:left;}
.user-c a{color:red;}
.user-c strong{text-align:center;font-size:14px;}
.user-c2 span{width:90px;float:left;display:block;text-align:center;}
.user-c2 th{text-align:center;font-size:16px;line-height:20px;height:20px;padding-bottom:10px;}
.user-c2 td{border-bottom:1px solid #76c3e5;}
.user-c2 a,.user-c2 strong a{text-decoration:none;}
#vedio li{width:38%;float:left;height:30px;line-height:30px;background:url(common/image/icon.gif) left no-repeat;padding-left:35px;overflow:hidden;}
#vedio{padding:5px 0px;}
</style>
 <script language="javascript">
 <!--
// window.onerror=function(){return true;}
	document.onkeypress = function(){
		if(document.activeElement.tagName == "INPUT" ||
		   document.activeElement.tagName == "TEXTAREA" )
		{
			return true;
		}
		else
		{
			location.replace("TS://Key"+String.fromCharCode(event.keyCode)); return false; 
 
		}
	}
 
 //-->
 </script>
</head>
<body>
<?php 
include 'class/DB_Mssql.class.php';
include 'class/DB_Mysql.class.php';
$mysql=new DB_Mysql();
$mysql->connect('localhost:3308','root','123456','phpcms');
$mysql->query('set names utf8');
putenv('TZ=Asia/Shanghai');
if(isset($_GET['userid']))
{
	$user=$_GET['userid'];
	$sql='select userid FROM phpcms_member WHERE username=\''.$user.'\'';
	$rs=$mysql->select($sql);
	if(!isset($rs[0]['userid']))
	{
		$sql='INSERT INTO phpcms_member (username) VALUES(\''.$user.'\')';;
		$mysql->query($sql);
		$sql='select userid FROM phpcms_member WHERE username=\''.$user.'\'';
		$rs=$mysql->select($sql);	
	}
	$userid=$rs[0]['userid'];
	sCookie('username',$user);
	sCookie('userid',$userid);
}
else if(gCookie('username')&&gCookie('userid'))
{
	sCookie('username',gCookie('username'));
	sCookie('userid',gCookie('userid'));
}
else
{
	exit('非法登录!');
}
if(gCookie('userid'))
{
	$userCenter=file_get_contents('http://crm.tsts168.com/idea/cus_info.php?userid='.gCookie('username'));
	if(gCookie(gCookie('userid').'set'))//如果客户端存在设置cookie，则使用客户端的cookie.
	{
		$set=str_replace('\"','"',descape(gCookie(gCookie('userid').'set')));
	}
	else
	{
		$sql='select * from php_member_set where uid='.gCookie('userid').' limit 1';
		$mysql->query('set names utf8');
		$rs=$mysql->select($sql);
		if(count($rs)==1)
		{
			$set=$rs[0]['uset'];
		}
		else	
		{
			$set='{
			catid:
			[
				{key:"31",name:"财经大事",num:9,show:1,list:0,database:0},
				{key:"32",name:"股市要闻",num:9,show:1,list:1,database:0},
				{key:"37",name:"市场评测",num:9,show:1,list:2,database:0},
				{key:"sjzl",name:"数据专栏",num:22,show:1,list:3,database:1},
				{key:"39",name:"港股资讯",num:9,show:1,list:4,database:0},
				{key:"38",name:"期货资讯",num:9,show:1,list:5,database:0},
				{key:"fav",name:"我的收藏",userid:'.gCookie('userid').',num:9,show:1,list:6,database:0,category:{num:10}},
				{key:"2491",name:"自选股资讯",show:1,num:9,list:7,database:0,zxg:"'.$zxg.'"}
			]
			}';
		}
	}
}
?>

<script type='text/javascript'>
var set=<?php echo $set;?>;
var user=<?php echo $userCenter;?>;
</script>
<!--头部区域-->
<dl class="header clear-after">
	<dt id='nowtime'>
	</dt>
	<script language="JavaScript">
	<!-----------
	getTime();
	function getTime()
	{
		var user=Cookie.get("username");
		setTimeout(time,100);
		function time()
		{
			date = new Date();
			var centry = "" ;
			var str = "";
			var h=date.getHours();
			date1 = centry + date.getFullYear()  + "年" + (date.getMonth() + 1 ) + "月" + date.getDate() + "日  " + h + ":" + date.getMinutes();
			if(h>=12 && h<24)
			{
				str = "  下午好";
			}
			if(h>=0 && h<12)
			{
				str = "  上午好";
			}
			$('#nowtime').html(date1+str+user);
		}
	}
	//----->
	</script>
	<dd>数据说话 科学决策</dd>
</dl>
<!--头部区域结束-->

<!--导航菜单-->
<div class="nav-menu">
    <ul>
		<li><a href="/">刷新首页</a></li>
        <li class="selected"><a href="/cms/cjds/" title="财经大事">财经大事</a></li>
        <li><a href="/cms/gsyw/" title="股市要闻">股市要闻</a></li>
        <li><a href="/cms/scpc/" title="市场评测">市场评测</a></li>
        <li><a href="/cms/qhzx/" title="期货资讯">期货资讯</a></li>
		<li><a href="/cms/ggzx/">港股资讯</a></li>
		<li><a href="/cms/zxg/?zxg<?php echo $zxg;?>">自选股资讯</a></li>
		<li><a href="/cms/collect.php">我的收藏</a></li>
		<li><a href="javascript:void(0)" onclick='DivBox.init(250,160)'>设置</a></li>
		<li><a href="javascript:void(0)" onclick='updateSet()'>保存布局</a></li>
        <li class="other" onmouseout='hiddenAd()'>
			<span class="user-ico" onmouseover='showAd("user",1)' id='user'><a href="#" title="用户中心">用户中心</a></span>
			<span class="t-ico" onmouseover='showAd("touzi",2)' id='touzi'><a href="#" title="教学园地">教学园地</a></span>
            <!--<span class="video-ico" onmouseover='hiddenAd()'><a href="#" title="课件">课件</a></span>
            <span class="exc-p-ico" onmouseover='hiddenAd()'><a href="http://wiki.tccj168.com/" title="帮助中心">帮助中心</a></span>-->
            <span class="earth-ico" onmouseover='hiddenAd()'><a href="#" title="公司简介">公司简介</a></span>
        </li>
    </ul>
</div>
<!--导航菜单结束-->
<div class="clear"></div>
<div id="sj">
</div>
</div>
<div class="clear"></div>
<div id='top_ad' name='top_ad' class='user-c'>
		
</div>
<div id='top_ad' name='top_ad' class='user-c2'>
	<table cellspacing=0 cellpadding=0 border=0>
	<tr><td colspan=2>
	<span><a href='http://wiki.tccj168.com/wiki/index.php/%E9%A6%96%E9%A1%B5' target=_blank>使用说明书</a></span><span><a href='http://www.tccj168.com/kefu/down/7/' target=_blank>课件说明视频</a></span><span><a href='http://v.tccj168.com/' target=_blank>媒体节目</a></span></td>
	</tr>
	<tr>
	<td>
	<a href='http://bbs.tccj168.com/' target=_blank><strong>掌股论坛</strong></a>
	<ul>
	<script type='text/javascript' charset="UTF-8" src='/cms/api/js.php?tagname=%E6%8E%8C%E8%82%A1%E8%AE%BA%E5%9D%9B'></script>
	</ul>
	</td>
	<td>
	<a href='http://www.tccj168.com/kefu/' target=_blank><strong>常见问题</strong></a>
	<ul>
	<script type='text/javascript' charset="UTF-8" src='/cms/api/js.php?tagname=%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98'></script>
	</ul>
	</td>
	</tr>
	<tr><td colspan=2 id='vedio'><script type='text/javascript' src='/cms/api/js.php?tagname=%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B'></script></td></tr>
	</table>
	</div>
<script type='text/javascript' src='common/js/public.js' charset='utf-8'></script>
</body>
</html>